Previous Book Contents Book Index Next

Inside Macintosh: Mac OS 8 Toolbox Reference /
Chapter 2 - Control Manager Reference / Control Manager Functions
Accessing and Changing Control Settings and Data /


GetControlData

NEW WITH THE APPEARANCE MANAGER

Gets control-specific data.

pascal OSErr GetControlData (
                     ControlHandle inControl,
                     ControlPartCode inPart,
                     ResType inTagName,
                     Size inBufferSize,
                     Ptr inBuffer,
                     Size *outActualSize);
inControl
On input, a handle to the specified control.
inPart
The part code of the control part whose control-specific data you wish to set; see "Control Part Code Constants". Passing kControlEntireControl indicates that either the control has no parts or the data is not tied to any specific part of the control.
inTagName
A constant representing the control-specific data you wish to get; see "Control Data Tag Constants".
inBufferSize
The size (in bytes) of the data pointed to by the inBuffer parameter. For variable-length control data, pass the value returned in the outMaxSize parameter of GetControlDataSize in the inBufferSize parameter. The number of bytes must match the actual data size.
inBuffer
On input, a pointer to a buffer allocated by your application. On output, a copy of the control-specific data. If you pass nil on input, it is equivalent to calling GetControlDataSize. The actual size of the control-specific data will be returned in the outActualSize parameter. For variable-length data, the number of bytes must match the actual data size.
outActualSize
On output, a pointer to the actual size of the data.
function result
A result code; see "Result Codes". The result code errDataNotSupported indicates that the inTagName parameter is not valid. The result code errDataSizeMismatch indicates that the value in the inBufferSize parameter does not match the value in the outActualSize parameter.
DISCUSSION
The GetControlData function will only copy the amount of data specified in the inBufferSize parameter, but will tell you the actual size of the buffer so you will know if the data was truncated.

SEE ALSO
SetControlData.

"Appearance Manager Gestalt Selector Constants".


Previous Book Contents Book Index Next

© Apple Computer, Inc.
8 JAN 1998